/**
 * Symbol创建对象属性
 */

// 向对象中添加方法 up down
let game = {
  name: "游戏"
};

// 声明于一个对象
let methods = {
  up: Symbol("up"),
  down: Symbol("down")
};

game[methods.up] = function () {
  console.log("我可以up");
};
game[methods.down] = function () {
  console.log("我可以down");
};
// console.log(game);
// game[methods.up]();

let youxi = {
  name: "狼人杀",
  [Symbol.for("say")]: function () {
    console.log("我可以发言");
  },
  [Symbol.for("zibao")]: function () {
    console.log("我可以自爆");
  }
};

youxi[Symbol.for("say")]();
